<!-- 项目策划考核季度汇总 查看 -->
<template>
  <base-breadcrumb style="padding-bottom: 50px;">
    <a-spin :spinning="loading">
      <a-card>
        <title-name title="基本信息" />
        <custom-form
          ref="form"
          :is-validate="true"
          :edit-model="''"
          :rules="rules"
          :form="form"
          :is-emit="false"
          :form-list="formOption"
        >
        </custom-form>
      </a-card>
      <a-card>
        <title-name title="策划执行书考核月度汇总" />
        <b-table
          :scroll="{ x: 1200 }"
          bordered
          :defaultLoad="true"
          ref="table"
          size="default"
          rowKey="id"
          :columns="detailColums"
          :request="loadData"
          :showPage="false"
          show-pagination="false"
        >
          <span slot="serial" slot-scope="text, record, index">{{ index + 1 }}</span>
        </b-table>
      </a-card>
      <div class="tool-btns page-btn-right-top" style="position: fixed; bottom: 0px; right: 50px; height: 50px; display: flex; align-items: center;">
        <a-button class="ml20" @click="handleClose"> 关闭 </a-button>
      </div>
    </a-spin>
  </base-breadcrumb>
</template>
<script>
import SelectSubCompany from "@/components/Select/SelectSubCompany"
import SelectProject from "@/components/Select/SelectProject"
import SelectPersonByProject from "@/components/Select/SelectPersonByProject"
import { getProjectsDel } from '@/api/project/projects.js' 
import { getPlanExamineQuarterById } from '@/api/project/projectPlanningAssessment'
import { finishBusinessTodo } from '@/api/commons.js'
import { formTable, detailColums, testData } from './model.js'
import moment from 'moment'
export default {
  name: "a" + Date.now(),
  components: {
    SelectSubCompany,
    SelectPersonByProject,
  },
  data() {
    return {
      detailColums,
      // 页面加载
      loading: false,
      isValidate: false,
      // 表单
      form: {
        branchComName: '',
        examineYearQuarter: '',
      },
      loadData: (parameter) => {
        const requestParameters = Object.assign({}, parameter, { param: {id: this.$route.query.id} })
        // return new Promise((resove, reject) => {
        //   resove({
        //     code: 200,
        //     data: [],
        //     pageNum: 1,
        //     pageSize: 10,
        //     total: 6
        //   })
        // })
        return getPlanExamineQuarterById(this.$route.query.id).then((res) => {
          console.log(res)
          this.form = res.data
          return {code: 200, data: res.data.itemList, ...res.data }
        }).catch((err) => {
          return {
            code: 500,
            err
          }
        })
      },
    }
  },
  created() {
  },
  computed: {
    pageType() {
      return this.$route.query.type
    },
    editable() {
      return this.pageType == 'edit'
    },
    // 表单配置
    formOption() {
      const list = [
        {
          label: "分公司",
          keyName: "branchComName",
          disabled: true,
          type: "BaseInput",
        },
        {
          label: "考核时间",
          keyName: "examineYearQuarter",
          type: "BaseInput",
          disabled: true,
        },
      ]
      return list
    },
    // 校验
    rules() {
      const obj = {}
      this.formOption.map((item) => {
        if (item.rules) {
          obj[item.keyName] = item.rules
        }
      })
      return obj
    },
  },
  watch: {
  },
  methods: {
    initPage() {
    },
    /**
     * @description: 关闭
     * @param {void}
     * @return {void}
     */
    handleClose() {
      this.$multiTab.close(this.$route.fullpath)
    }
  }
}
</script>
<style lang="less" scoped>
</style>
